#pragma once

#include <stdio.h>
#include <stdarg.h>

#define BUFF_SIZE 1024

typedef struct IO_FILE
{
  int fileno;
  char inbuff[BUFF_SIZE];
  int inbuff_pos;
  char outbuff[BUFF_SIZE];
  int outbuff_pos;
}_FILE;

_FILE _st_stdin;
_FILE _st_stdout;
_FILE _st_stderr;

_FILE* _stdin;
_FILE* _stdout;
_FILE* _stderr;

_FILE* _fopen(const char* filename, const char* flag);
int _fwrite(const void* buff, int size, int nmem, _FILE* pf);
int _vsprintf(char* buff, const char* format, va_list argsptr);
int _printf(const char* format, ...);

int _fclose(_FILE* pf);
